using System;
using System.Text;

namespace iBeauty.BusinessObjects
{
	[Serializable()]
	public class Product
	{
		private string _ID;

		public string ID
		{
			get { return _ID; }
			set { _ID = value; }
		}

		private DateTime? _CreateDate;

		public DateTime? CreateDate
		{
			get { return _CreateDate; }
			set { _CreateDate = value; }
		}

		private DateTime? _ModifiedDate;

		public DateTime? ModifiedDate
		{
			get { return _ModifiedDate; }
			set { _ModifiedDate = value; }
		}

		private DateTime? _TimeStamp;

		public DateTime? TimeStamp
		{
			get { return _TimeStamp; }
			set { _TimeStamp = value; }
		}

		private string _ProductCode;

		public string ProductCode
		{
			get { return _ProductCode; }
			set { _ProductCode = value; }
		}

		private string _ProductName;

		public string ProductName
		{
			get { return _ProductName; }
			set { _ProductName = value; }
		}

		private string _GroupId;

		public string GroupId
		{
			get { return _GroupId; }
			set { _GroupId = value; }
		}

		private Single? _OriginalPrice;

		public Single? OriginalPrice
		{
			get { return _OriginalPrice; }
			set { _OriginalPrice = value; }
		}

		private Single? _SalePrice;

		public Single? SalePrice
		{
			get { return _SalePrice; }
			set { _SalePrice = value; }
		}

		private Single? _OriginalForeignPrice;

		public Single? OriginalForeignPrice
		{
			get { return _OriginalForeignPrice; }
			set { _OriginalForeignPrice = value; }
		}

		private Single? _SaleForeignPrice;

		public Single? SaleForeignPrice
		{
			get { return _SaleForeignPrice; }
			set { _SaleForeignPrice = value; }
		}

		private string _Currency;

		public string Currency
		{
			get { return _Currency; }
			set { _Currency = value; }
		}

		private string _Barcode;

		public string Barcode
		{
			get { return _Barcode; }
			set { _Barcode = value; }
		}

		private string _Unit;

		public string Unit
		{
			get { return _Unit; }
			set { _Unit = value; }
		}

		private Single? _Capacity;

		public Single? Capacity
		{
			get { return _Capacity; }
			set { _Capacity = value; }
		}

		private int? _AccountId;

		public int? AccountId
		{
			get { return _AccountId; }
			set { _AccountId = value; }
		}

		private string _Note;

		public string Note
		{
			get { return _Note; }
			set { _Note = value; }
		}

		public Product()
		{ }

		public Product(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string ProductCode,string ProductName,string GroupId,Single? OriginalPrice,Single? SalePrice,Single? OriginalForeignPrice,Single? SaleForeignPrice,string Currency,string Barcode,string Unit,Single? Capacity,int? AccountId,string Note)
		{
			this.ID = ID;
			this.CreateDate = CreateDate;
			this.ModifiedDate = ModifiedDate;
			this.TimeStamp = TimeStamp;
			this.ProductCode = ProductCode;
			this.ProductName = ProductName;
			this.GroupId = GroupId;
			this.OriginalPrice = OriginalPrice;
			this.SalePrice = SalePrice;
			this.OriginalForeignPrice = OriginalForeignPrice;
			this.SaleForeignPrice = SaleForeignPrice;
			this.Currency = Currency;
			this.Barcode = Barcode;
			this.Unit = Unit;
			this.Capacity = Capacity;
			this.AccountId = AccountId;
			this.Note = Note;
		}

		public override string ToString()
		{
			return "ID = " + ID + ",CreateDate = " + CreateDate.ToString() + ",ModifiedDate = " + ModifiedDate.ToString() + ",TimeStamp = " + TimeStamp.ToString() + ",ProductCode = " + ProductCode + ",ProductName = " + ProductName + ",GroupId = " + GroupId + ",OriginalPrice = " + OriginalPrice.ToString() + ",SalePrice = " + SalePrice.ToString() + ",OriginalForeignPrice = " + OriginalForeignPrice.ToString() + ",SaleForeignPrice = " + SaleForeignPrice.ToString() + ",Currency = " + Currency + ",Barcode = " + Barcode + ",Unit = " + Unit + ",Capacity = " + Capacity.ToString() + ",AccountId = " + AccountId.ToString() + ",Note = " + Note;
		}

		public class IDComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public IDComparer()
			{ }
			public IDComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ID.CompareTo(x.ID);
				}
				else
				{
					return x.ID.CompareTo(y.ID);
				}
			}
			#endregion
		}
		public class ProductCodeComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public ProductCodeComparer()
			{ }
			public ProductCodeComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ProductCode.CompareTo(x.ProductCode);
				}
				else
				{
					return x.ProductCode.CompareTo(y.ProductCode);
				}
			}
			#endregion
		}
		public class ProductNameComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public ProductNameComparer()
			{ }
			public ProductNameComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ProductName.CompareTo(x.ProductName);
				}
				else
				{
					return x.ProductName.CompareTo(y.ProductName);
				}
			}
			#endregion
		}
		public class GroupIdComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public GroupIdComparer()
			{ }
			public GroupIdComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.GroupId.CompareTo(x.GroupId);
				}
				else
				{
					return x.GroupId.CompareTo(y.GroupId);
				}
			}
			#endregion
		}
		public class CurrencyComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public CurrencyComparer()
			{ }
			public CurrencyComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Currency.CompareTo(x.Currency);
				}
				else
				{
					return x.Currency.CompareTo(y.Currency);
				}
			}
			#endregion
		}
		public class BarcodeComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public BarcodeComparer()
			{ }
			public BarcodeComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Barcode.CompareTo(x.Barcode);
				}
				else
				{
					return x.Barcode.CompareTo(y.Barcode);
				}
			}
			#endregion
		}
		public class UnitComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public UnitComparer()
			{ }
			public UnitComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Unit.CompareTo(x.Unit);
				}
				else
				{
					return x.Unit.CompareTo(y.Unit);
				}
			}
			#endregion
		}
		public class NoteComparer : System.Collections.Generic.IComparer<Product>
		{
			public SorterMode SorterMode;
			public NoteComparer()
			{ }
			public NoteComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Product> Membres
			int System.Collections.Generic.IComparer<Product>.Compare(Product x, Product y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Note.CompareTo(x.Note);
				}
				else
				{
					return x.Note.CompareTo(y.Note);
				}
			}
			#endregion
		}
	}
}
